package study7.draw1;

import java.awt.event.*;
public class MMouseListener implements MouseListener{

	int x1,y1,x2,y2,clickcount =0;

	public void mouseClicked(MouseEvent arg0) {

	}

	public void mouseEntered(MouseEvent arg0) {


	}

	public void mouseExited(MouseEvent arg0) {


	}

	public void mousePressed(MouseEvent arg0) {


	}

	public void mouseReleased(MouseEvent arg0) {
		if(clickcount==0){
			x1=arg0.getX();
			y1=arg0.getY();
			clickcount++;
		}
		else{
			x2=arg0.getX();
			y2=arg0.getY();
			clickcount--;
			System.out.println("x1:"+x1+" y1:"+y1+" x2:"+x2+" y2:"+y2);
		}

	}

}
